/* ============================================
   云卡栈 - 高级感UI系统 v10.0
   进阶优化20项（第141-160项）
   总计160项高级感优化
   ============================================ */

/* ========== 141. 新手引导 ========== */
.onboarding-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.7);
  z-index: 6000;
  display: flex;
  align-items: center;
  justify-content: center;
}

.onboarding-highlight {
  position: relative;
  z-index: 6001;
  box-shadow: 0 0 0 9999px rgba(0,0,0,0.7);
  border-radius: 8px;
}

.onboarding-tooltip {
  position: fixed;
  background: var(--bg-card);
  border-radius: 12px;
  padding: 16px;
  max-width: 280px;
  z-index: 6002;
  box-shadow: var(--shadow-2xl);
  animation: tooltipPop 0.3s ease;
}

@keyframes tooltipPop {
  from { opacity: 0; transform: scale(0.8) translateY(10px); }
  to { opacity: 1; transform: scale(1) translateY(0); }
}

.onboarding-tooltip-title {
  font-size: 16px;
  font-weight: 600;
  margin-bottom: 8px;
  color: var(--text-primary);
}

.onboarding-tooltip-desc {
  font-size: 14px;
  color: var(--text-secondary);
  margin-bottom: 12px;
  line-height: 1.5;
}

.onboarding-tooltip-actions {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.onboarding-progress {
  display: flex;
  gap: 4px;
}

.onboarding-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--bg-tertiary);
  transition: all 0.3s ease;
}

.onboarding-dot.active {
  background: var(--primary-500);
  width: 20px;
  border-radius: 4px;
}

/* ========== 142. 悬浮操作按钮 ========== */
.fab-container {
  position: fixed;
  bottom: 80px;
  right: 20px;
  z-index: 1500;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 12px;
}

.fab-main {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: var(--gradient-primary);
  color: white;
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 24px;
  box-shadow: 0 4px 16px rgba(102, 126, 234, 0.4);
  transition: all 0.3s ease;
}

.fab-main:hover {
  transform: scale(1.1) rotate(45deg);
  box-shadow: 0 6px 24px rgba(102, 126, 234, 0.5);
}

.fab-item {
  display: flex;
  align-items: center;
  gap: 8px;
  opacity: 0;
  transform: translateX(20px);
  transition: all 0.3s ease;
}

.fab-container.open .fab-item {
  opacity: 1;
  transform: translateX(0);
}

.fab-item-btn {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: var(--bg-card);
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  box-shadow: var(--shadow-md);
  transition: all 0.2s ease;
}

.fab-item-btn:hover {
  transform: scale(1.1);
}

.fab-item-label {
  background: var(--bg-card);
  padding: 4px 10px;
  border-radius: 4px;
  font-size: 12px;
  box-shadow: var(--shadow-sm);
  white-space: nowrap;
}

/* ========== 143. 手风琴菜单 ========== */
.accordion {
  border-radius: var(--radius-md);
  overflow: hidden;
}

.accordion-item {
  border-bottom: 1px solid var(--border-light);
}

.accordion-item:last-child {
  border-bottom: none;
}

.accordion-header {
  padding: 16px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: space-between;
  transition: background 0.2s ease;
}

.accordion-header:hover {
  background: var(--bg-secondary);
}

.accordion-title {
  font-size: 15px;
  font-weight: 500;
  color: var(--text-primary);
}

.accordion-icon {
  transition: transform 0.3s ease;
  color: var(--text-tertiary);
}

.accordion-item.open .accordion-icon {
  transform: rotate(180deg);
}

.accordion-content {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.4s ease;
}

.accordion-item.open .accordion-content {
  max-height: 500px;
}

.accordion-content-inner {
  padding: 0 16px 16px;
  color: var(--text-secondary);
  font-size: 14px;
  line-height: 1.6;
}

/* ========== 144. 无限轮播 ========== */
.infinite-carousel {
  position: relative;
  overflow: hidden;
  border-radius: var(--radius-lg);
}

.infinite-carousel-track {
  display: flex;
  transition: transform 0.5s ease;
}

.infinite-carousel-item {
  flex-shrink: 0;
  width: 100%;
}

.infinite-carousel-dots {
  position: absolute;
  bottom: 12px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  gap: 6px;
}

.infinite-carousel-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: rgba(255,255,255,0.5);
  cursor: pointer;
  transition: all 0.3s ease;
}

.infinite-carousel-dot.active {
  background: white;
  width: 24px;
  border-radius: 4px;
}

.infinite-carousel-arrow {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: rgba(0,0,0,0.3);
  color: white;
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  transition: background 0.2s ease;
}

.infinite-carousel-arrow:hover {
  background: rgba(0,0,0,0.5);
}

.infinite-carousel-arrow.prev { left: 12px; }
.infinite-carousel-arrow.next { right: 12px; }

/* ========== 145. 步骤指示器 ========== */
.step-indicator {
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: relative;
  padding: 0 20px;
}

.step-indicator::before {
  content: '';
  position: absolute;
  top: 20px;
  left: 40px;
  right: 40px;
  height: 2px;
  background: var(--bg-tertiary);
  z-index: 0;
}

.step-indicator-progress {
  position: absolute;
  top: 20px;
  left: 40px;
  height: 2px;
  background: var(--gradient-primary);
  z-index: 1;
  transition: width 0.5s ease;
}

.step-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  position: relative;
  z-index: 2;
}

.step-circle {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--bg-card);
  border: 2px solid var(--bg-tertiary);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
  color: var(--text-tertiary);
  transition: all 0.3s ease;
  margin-bottom: 8px;
}

.step-item.active .step-circle {
  background: var(--gradient-primary);
  border-color: transparent;
  color: white;
  transform: scale(1.1);
  box-shadow: var(--shadow-primary);
}

.step-item.completed .step-circle {
  background: var(--success);
  border-color: transparent;
  color: white;
}

.step-label {
  font-size: 12px;
  color: var(--text-secondary);
  text-align: center;
}

.step-item.active .step-label {
  color: var(--primary-600);
  font-weight: 600;
}

/* ========== 146. 数字滚动动画 ========== */
.animate-number {
  display: inline-block;
  font-variant-numeric: tabular-nums;
}

/* ========== 147. 进度条动画 ========== */
.animated-progress {
  height: 8px;
  background: var(--bg-tertiary);
  border-radius: 4px;
  overflow: hidden;
  position: relative;
}

.animated-progress-bar {
  height: 100%;
  background: var(--gradient-primary);
  border-radius: 4px;
  position: relative;
  transition: width 1s ease;
}

.animated-progress-bar::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.3), transparent);
  animation: progressShine 2s infinite;
}

@keyframes progressShine {
  0% { transform: translateX(-100%); }
  100% { transform: translateX(100%); }
}

/* ========== 148. 卡片磁吸效果 ========== */
.magnetic-card {
  transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* ========== 149. 视差滚动 ========== */
.parallax-container {
  position: relative;
  overflow: hidden;
}

.parallax-layer {
  position: absolute;
  inset: 0;
  will-change: transform;
}

.parallax-layer-bg {
  transform: translateZ(-1px) scale(2);
}

.parallax-layer-mid {
  transform: translateZ(-0.5px) scale(1.5);
}

.parallax-layer-front {
  transform: translateZ(0);
}

/* ========== 150. 按钮涟漪效果 ========== */
.ripple-btn {
  position: relative;
  overflow: hidden;
}

.ripple-effect {
  position: absolute;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.4);
  transform: scale(0);
  animation: rippleExpand 0.6s ease-out;
  pointer-events: none;
}

@keyframes rippleExpand {
  to { transform: scale(4); opacity: 0; }
}

/* ========== 151. 操作反馈 ========== */
.action-feedback {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%) scale(0);
  background: rgba(0,0,0,0.8);
  color: white;
  padding: 20px 30px;
  border-radius: 12px;
  z-index: 7000;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.action-feedback.show {
  transform: translate(-50%, -50%) scale(1);
}

.action-feedback-icon {
  font-size: 36px;
}

.action-feedback-text {
  font-size: 14px;
}

/* ========== 152. 错误恢复 ========== */
.error-recovery {
  padding: 40px 20px;
  text-align: center;
}

.error-recovery-code {
  font-size: 72px;
  font-weight: 700;
  background: var(--gradient-primary);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  margin-bottom: 16px;
}

.error-recovery-title {
  font-size: 20px;
  font-weight: 600;
  margin-bottom: 8px;
}

.error-recovery-desc {
  font-size: 14px;
  color: var(--text-secondary);
  margin-bottom: 24px;
}

.error-recovery-actions {
  display: flex;
  gap: 12px;
  justify-content: center;
}

/* ========== 153. 手势操作 ========== */
.swipe-nav {
  touch-action: pan-y;
  user-select: none;
}

/* ========== 154. 离线模式 ========== */
.offline-banner {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  background: var(--warning);
  color: white;
  padding: 10px 20px;
  text-align: center;
  font-size: 14px;
  z-index: 10000;
  transform: translateY(-100%);
  transition: transform 0.3s ease;
}

.offline-banner.show {
  transform: translateY(0);
}

/* ========== 155. 实时数据大屏 ========== */
.data-dashboard {
  background: linear-gradient(135deg, #0f172a, #1e293b);
  border-radius: var(--radius-lg);
  padding: 24px;
  color: white;
}

.data-dashboard-title {
  font-size: 18px;
  font-weight: 600;
  margin-bottom: 20px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.data-dashboard-title::before {
  content: '';
  width: 4px;
  height: 20px;
  background: var(--primary-400);
  border-radius: 2px;
}

.data-card {
  background: rgba(255,255,255,0.05);
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 12px;
  padding: 16px;
  backdrop-filter: blur(10px);
}

.data-card-value {
  font-size: 28px;
  font-weight: 700;
  margin-bottom: 4px;
}

.data-card-label {
  font-size: 12px;
  opacity: 0.7;
}

.data-card-trend {
  font-size: 12px;
  margin-top: 8px;
}

.data-card-trend.up { color: #10b981; }
.data-card-trend.down { color: #ef4444; }

/* ========== 156. 热力图 ========== */
.heatmap {
  display: grid;
  gap: 2px;
}

.heatmap-cell {
  aspect-ratio: 1;
  border-radius: 2px;
  background: var(--bg-tertiary);
  transition: all 0.2s ease;
  cursor: pointer;
}

.heatmap-cell:hover {
  transform: scale(1.2);
  z-index: 1;
}

.heatmap-cell.level-1 { background: rgba(59, 130, 246, 0.2); }
.heatmap-cell.level-2 { background: rgba(59, 130, 246, 0.4); }
.heatmap-cell.level-3 { background: rgba(59, 130, 246, 0.6); }
.heatmap-cell.level-4 { background: rgba(59, 130, 246, 0.8); }
.heatmap-cell.level-5 { background: rgba(59, 130, 246, 1); }

/* ========== 157. 漏斗图 ========== */
.funnel-chart {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
}

.funnel-stage {
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-size: 13px;
  font-weight: 500;
  position: relative;
  transition: all 0.3s ease;
}

.funnel-stage:hover {
  filter: brightness(1.1);
  transform: scale(1.02);
}

.funnel-stage-label {
  position: absolute;
  left: -120px;
  width: 110px;
  text-align: right;
  color: var(--text-secondary);
  font-size: 12px;
}

.funnel-stage-value {
  position: absolute;
  right: -80px;
  width: 70px;
  text-align: left;
  color: var(--text-primary);
  font-size: 12px;
  font-weight: 600;
}

/* ========== 158. 雷达图 ========== */
.radar-chart {
  position: relative;
  width: 200px;
  height: 200px;
}

.radar-chart svg {
  width: 100%;
  height: 100%;
}

.radar-polygon {
  fill: rgba(59, 130, 246, 0.2);
  stroke: var(--primary-500);
  stroke-width: 2;
  transition: all 0.5s ease;
}

.radar-grid {
  fill: none;
  stroke: var(--border-light);
  stroke-width: 1;
}

.radar-axis {
  stroke: var(--border-light);
  stroke-width: 1;
}

.radar-label {
  font-size: 11px;
  fill: var(--text-secondary);
}

/* ========== 159. AI智能推荐 ========== */
.ai-recommend {
  position: relative;
}

.ai-recommend-badge {
  position: absolute;
  top: 8px;
  left: 8px;
  background: linear-gradient(135deg, #8b5cf6, #ec4899);
  color: white;
  padding: 2px 8px;
  border-radius: 10px;
  font-size: 10px;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 4px;
}

.ai-recommend-badge::before {
  content: '✨';
  font-size: 10px;
}

/* ========== 160. AI搜索联想 ========== */
.ai-search-suggestions {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  background: var(--bg-card);
  border-radius: 0 0 var(--radius-lg) var(--radius-lg);
  box-shadow: var(--shadow-lg);
  border: 1px solid var(--border-light);
  border-top: none;
  max-height: 300px;
  overflow-y: auto;
  z-index: 100;
  display: none;
}

.ai-search-suggestions.show {
  display: block;
  animation: slideDown 0.2s ease;
}

.ai-suggestion-item {
  padding: 10px 16px;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 10px;
  transition: background 0.15s ease;
}

.ai-suggestion-item:hover {
  background: var(--bg-secondary);
}

.ai-suggestion-icon {
  color: var(--primary-500);
  font-size: 14px;
}

.ai-suggestion-text {
  flex: 1;
  font-size: 14px;
  color: var(--text-primary);
}

.ai-suggestion-text mark {
  background: var(--primary-100);
  color: var(--primary-600);
  padding: 0 2px;
  border-radius: 2px;
}

.ai-suggestion-type {
  font-size: 11px;
  color: var(--text-tertiary);
  background: var(--bg-secondary);
  padding: 2px 6px;
  border-radius: 4px;
}

/* 响应式 */
@media (max-width: 768px) {
  .data-dashboard { padding: 16px; }
  .data-card-value { font-size: 22px; }
  .radar-chart { width: 160px; height: 160px; }
  .funnel-stage-label { display: none; }
  .funnel-stage-value { display: none; }
}
