/* ============================================
   云卡栈 - 高级感UI系统 v4.0
   新增20项深度优化
   ============================================ */

/* ========== 21. 长按快捷菜单 ========== */
.long-press-menu {
  position: fixed;
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-2xl);
  padding: 8px;
  z-index: 2500;
  min-width: 160px;
  animation: menuPop 0.2s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes menuPop {
  from { opacity: 0; transform: scale(0.8); }
  to { opacity: 1; transform: scale(1); }
}

.long-press-menu-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  border-radius: var(--radius-md);
  cursor: pointer;
  font-size: 14px;
  color: var(--text-primary);
  transition: all 0.15s ease;
}

.long-press-menu-item:hover {
  background: var(--bg-secondary);
}

.long-press-menu-item:active {
  transform: scale(0.98);
}

.long-press-menu-item.danger {
  color: var(--danger);
}

.long-press-menu-item svg {
  width: 18px;
  height: 18px;
  stroke: currentColor;
}

.long-press-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.3);
  z-index: 2499;
  animation: fadeIn 0.2s ease;
}

/* ========== 22. 视差滚动 ========== */
.parallax-container {
  position: relative;
  overflow: hidden;
}

.parallax-bg {
  position: absolute;
  top: -20%;
  left: 0;
  right: 0;
  height: 140%;
  background-size: cover;
  background-position: center;
  will-change: transform;
  z-index: -1;
}

.parallax-content {
  position: relative;
  z-index: 1;
}

/* ========== 23. 磁性按钮 ========== */
.magnetic-btn {
  position: relative;
  transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
  will-change: transform;
}

/* ========== 24. 卡片3D倾斜 ========== */
.tilt-card {
  transform-style: preserve-3d;
  perspective: 1000px;
  transition: transform 0.3s ease;
  will-change: transform;
}

.tilt-card-inner {
  transform: translateZ(20px);
}

.tilt-card-glare {
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, rgba(255,255,255,0.3) 0%, transparent 50%);
  opacity: 0;
  transition: opacity 0.3s ease;
  pointer-events: none;
  border-radius: inherit;
}

.tilt-card:hover .tilt-card-glare {
  opacity: 1;
}

/* ========== 25. 手风琴折叠 ========== */
.accordion {
  border-radius: var(--radius-lg);
  overflow: hidden;
  background: var(--bg-card);
  border: 1px solid var(--border-light);
}

.accordion-item {
  border-bottom: 1px solid var(--border-light);
}

.accordion-item:last-child {
  border-bottom: none;
}

.accordion-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  cursor: pointer;
  font-weight: 600;
  font-size: 15px;
  transition: background 0.2s ease;
}

.accordion-header:hover {
  background: var(--bg-secondary);
}

.accordion-icon {
  width: 20px;
  height: 20px;
  transition: transform 0.3s ease;
}

.accordion-item.active .accordion-icon {
  transform: rotate(180deg);
}

.accordion-content {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.3s ease;
}

.accordion-item.active .accordion-content {
  max-height: 500px;
}

.accordion-body {
  padding: 0 20px 16px;
  color: var(--text-secondary);
  font-size: 14px;
  line-height: 1.6;
}

/* ========== 26. 环形进度条 ========== */
.circular-progress {
  position: relative;
  width: 120px;
  height: 120px;
}

.circular-progress svg {
  transform: rotate(-90deg);
}

.circular-progress-bg {
  fill: none;
  stroke: var(--bg-tertiary);
  stroke-width: 8;
}

.circular-progress-bar {
  fill: none;
  stroke: url(#circularGradient);
  stroke-width: 8;
  stroke-linecap: round;
  stroke-dasharray: 314;
  stroke-dashoffset: 314;
  transition: stroke-dashoffset 1s ease;
}

.circular-progress-text {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

.circular-progress-value {
  font-size: 28px;
  font-weight: 700;
  color: var(--text-primary);
}

.circular-progress-label {
  font-size: 12px;
  color: var(--text-secondary);
}

/* ========== 27. 步骤指示器 ========== */
.steps {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 0;
}

.step {
  display: flex;
  flex-direction: column;
  align-items: center;
  position: relative;
  flex: 1;
}

.step-circle {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--bg-tertiary);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
  font-size: 16px;
  color: var(--text-tertiary);
  transition: all 0.3s ease;
  z-index: 1;
}

.step.active .step-circle {
  background: var(--gradient-primary);
  color: white;
  box-shadow: var(--shadow-primary);
  transform: scale(1.1);
}

.step.completed .step-circle {
  background: var(--success);
  color: white;
}

.step-label {
  margin-top: 8px;
  font-size: 12px;
  color: var(--text-secondary);
  text-align: center;
}

.step.active .step-label {
  color: var(--primary-600);
  font-weight: 600;
}

.step-line {
  position: absolute;
  top: 20px;
  left: calc(50% + 24px);
  right: calc(-50% + 24px);
  height: 2px;
  background: var(--bg-tertiary);
}

.step.completed .step-line {
  background: var(--success);
}

/* ========== 28. 时间轴 ========== */
.timeline {
  position: relative;
  padding-left: 30px;
}

.timeline::before {
  content: '';
  position: absolute;
  left: 10px;
  top: 0;
  bottom: 0;
  width: 2px;
  background: linear-gradient(to bottom, var(--primary-400), var(--bg-tertiary));
}

.timeline-item {
  position: relative;
  padding-bottom: 24px;
}

.timeline-item:last-child {
  padding-bottom: 0;
}

.timeline-dot {
  position: absolute;
  left: -26px;
  top: 4px;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: var(--bg-card);
  border: 3px solid var(--primary-400);
  box-shadow: 0 0 0 4px rgba(59, 130, 246, 0.1);
}

.timeline-item.active .timeline-dot {
  background: var(--primary-500);
  animation: timelinePulse 2s infinite;
}

@keyframes timelinePulse {
  0%, 100% { box-shadow: 0 0 0 4px rgba(59, 130, 246, 0.2); }
  50% { box-shadow: 0 0 0 8px rgba(59, 130, 246, 0.1); }
}

.timeline-time {
  font-size: 12px;
  color: var(--text-tertiary);
  margin-bottom: 4px;
}

.timeline-title {
  font-size: 15px;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 4px;
}

.timeline-desc {
  font-size: 13px;
  color: var(--text-secondary);
  line-height: 1.5;
}

/* ========== 29. 标签云 ========== */
.tag-cloud {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  padding: 16px;
}

.tag-cloud-item {
  padding: 6px 14px;
  border-radius: 20px;
  background: var(--bg-secondary);
  color: var(--text-secondary);
  font-size: 13px;
  cursor: pointer;
  transition: all 0.2s ease;
  text-decoration: none;
}

.tag-cloud-item:hover {
  background: var(--gradient-primary);
  color: white;
  transform: translateY(-2px);
  box-shadow: var(--shadow-primary);
}

.tag-cloud-item.hot {
  background: linear-gradient(135deg, rgba(239, 68, 68, 0.1), rgba(245, 158, 11, 0.1));
  color: var(--danger);
  font-weight: 600;
}

.tag-cloud-item.hot:hover {
  background: linear-gradient(135deg, #ef4444, #f59e0b);
  color: white;
}

/* ========== 30. 瀑布流布局 ========== */
.masonry {
  column-count: 2;
  column-gap: 12px;
}

@media (min-width: 768px) {
  .masonry { column-count: 3; }
}

@media (min-width: 1024px) {
  .masonry { column-count: 4; }
}

.masonry-item {
  break-inside: avoid;
  margin-bottom: 12px;
  border-radius: var(--radius-lg);
  overflow: hidden;
  background: var(--bg-card);
  box-shadow: var(--shadow-sm);
  transition: all 0.3s ease;
}

.masonry-item:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-xl);
}

.masonry-item img {
  width: 100%;
  display: block;
}

.masonry-item-content {
  padding: 12px;
}

/* ========== 31. 上拉加载更多 ========== */
.load-more {
  padding: 20px;
  text-align: center;
  color: var(--text-secondary);
  font-size: 14px;
}

.load-more-loading {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.load-more-spinner {
  width: 16px;
  height: 16px;
  border: 2px solid var(--bg-tertiary);
  border-top-color: var(--primary-500);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

/* ========== 32. 搜索联想建议 ========== */
.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;
  animation: slideDown 0.2s ease;
}

@keyframes slideDown {
  from { opacity: 0; transform: translateY(-10px); }
  to { opacity: 1; transform: translateY(0); }
}

.search-suggestion-item {
  padding: 12px 16px;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 14px;
  color: var(--text-primary);
  transition: background 0.15s ease;
}

.search-suggestion-item:hover {
  background: var(--bg-secondary);
}

.search-suggestion-item svg {
  width: 16px;
  height: 16px;
  stroke: var(--text-tertiary);
  flex-shrink: 0;
}

.search-suggestion-highlight {
  color: var(--primary-600);
  font-weight: 600;
}

/* ========== 33. 标签多选输入 ========== */
.tag-input {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 10px 12px;
  border: 1.5px solid var(--border-light);
  border-radius: var(--radius-md);
  background: var(--bg-card);
  min-height: 48px;
  align-items: center;
  cursor: text;
  transition: all 0.2s ease;
}

.tag-input:focus-within {
  border-color: var(--primary-400);
  box-shadow: 0 0 0 4px rgba(59, 130, 246, 0.1);
}

.tag-input-tag {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  background: var(--primary-50);
  color: var(--primary-700);
  border-radius: 16px;
  font-size: 13px;
  animation: tagIn 0.2s ease;
}

@keyframes tagIn {
  from { opacity: 0; transform: scale(0.8); }
  to { opacity: 1; transform: scale(1); }
}

.tag-input-tag-remove {
  cursor: pointer;
  opacity: 0.6;
  transition: opacity 0.2s;
  font-size: 16px;
  line-height: 1;
}

.tag-input-tag-remove:hover {
  opacity: 1;
}

.tag-input input {
  border: none;
  outline: none;
  flex: 1;
  min-width: 100px;
  font-size: 14px;
  background: transparent;
  color: var(--text-primary);
}

/* ========== 34. 星级评分 ========== */
.rating {
  display: inline-flex;
  gap: 4px;
  cursor: pointer;
}

.rating-star {
  width: 24px;
  height: 24px;
  color: var(--bg-tertiary);
  transition: all 0.15s ease;
  cursor: pointer;
}

.rating-star.filled {
  color: #fbbf24;
}

.rating-star.half {
  background: linear-gradient(90deg, #fbbf24 50%, var(--bg-tertiary) 50%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.rating:hover .rating-star {
  transform: scale(1.1);
}

.rating:hover .rating-star:hover ~ .rating-star {
  transform: scale(1);
  color: var(--bg-tertiary);
}

.rating-text {
  margin-left: 8px;
  font-size: 14px;
  color: var(--text-secondary);
}

/* ========== 35. 跑马灯公告 ========== */
.marquee {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 16px;
  background: linear-gradient(135deg, rgba(59, 130, 246, 0.05), rgba(139, 92, 246, 0.05));
  border-radius: var(--radius-md);
  overflow: hidden;
}

.marquee-icon {
  flex-shrink: 0;
  color: var(--primary-500);
  font-size: 18px;
}

.marquee-content {
  flex: 1;
  overflow: hidden;
  white-space: nowrap;
}

.marquee-text {
  display: inline-block;
  animation: marqueeScroll 20s linear infinite;
  font-size: 14px;
  color: var(--text-secondary);
}

@keyframes marqueeScroll {
  0% { transform: translateX(100%); }
  100% { transform: translateX(-100%); }
}

.marquee:hover .marquee-text {
  animation-play-state: paused;
}

/* ========== 36. 打字机效果 ========== */
.typewriter {
  overflow: hidden;
  border-right: 2px solid var(--primary-500);
  white-space: nowrap;
  animation: typing 3s steps(40, end), blink 0.75s step-end infinite;
}

@keyframes typing {
  from { width: 0; }
  to { width: 100%; }
}

@keyframes blink {
  from, to { border-color: transparent; }
  50% { border-color: var(--primary-500); }
}

/* ========== 37. 数字翻牌器 ========== */
.flip-counter {
  display: inline-flex;
  gap: 2px;
  font-variant-numeric: tabular-nums;
}

.flip-digit {
  position: relative;
  width: 32px;
  height: 44px;
  background: var(--gray-900);
  color: white;
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 24px;
  font-weight: 700;
  overflow: hidden;
  box-shadow: 0 2px 8px rgba(0,0,0,0.2);
}

.flip-digit::before {
  content: '';
  position: absolute;
  top: 50%;
  left: 0;
  right: 0;
  height: 1px;
  background: rgba(0,0,0,0.3);
}

.flip-digit.flipping {
  animation: flipDigit 0.6s ease;
}

@keyframes flipDigit {
  0% { transform: rotateX(0); }
  50% { transform: rotateX(90deg); }
  100% { transform: rotateX(0); }
}

/* ========== 38. 粒子背景 ========== */
.particles-bg {
  position: fixed;
  inset: 0;
  z-index: -1;
  overflow: hidden;
  background: var(--gradient-dark);
}

.particle {
  position: absolute;
  width: 4px;
  height: 4px;
  background: rgba(255,255,255,0.5);
  border-radius: 50%;
  animation: particleFloat 15s infinite;
}

@keyframes particleFloat {
  0%, 100% { transform: translateY(0) translateX(0); opacity: 0; }
  10% { opacity: 1; }
  90% { opacity: 1; }
  100% { transform: translateY(-100vh) translateX(50px); opacity: 0; }
}

/* ========== 39. 玻璃拟态卡片 ========== */
.glassmorphism-card {
  background: rgba(255, 255, 255, 0.1);
  backdrop-filter: blur(20px) saturate(180%);
  -webkit-backdrop-filter: blur(20px) saturate(180%);
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: var(--radius-xl);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
  padding: 24px;
  transition: all 0.3s ease;
}

.glassmorphism-card:hover {
  background: rgba(255, 255, 255, 0.15);
  transform: translateY(-4px);
  box-shadow: 0 16px 48px rgba(0, 0, 0, 0.15);
}

/* ========== 40. 霓虹发光效果 ========== */
.neon-border {
  position: relative;
  border: 2px solid transparent;
  background: var(--bg-card);
  background-clip: padding-box;
  border-radius: var(--radius-lg);
}

.neon-border::before {
  content: '';
  position: absolute;
  inset: -2px;
  border-radius: inherit;
  background: linear-gradient(135deg, #667eea, #764ba2, #f093fb, #667eea);
  background-size: 300% 300%;
  z-index: -1;
  animation: neonGradient 3s ease infinite;
  filter: blur(8px);
  opacity: 0.7;
}

@keyframes neonGradient {
  0% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
  100% { background-position: 0% 50%; }
}

.neon-text {
  color: #fff;
  text-shadow: 
    0 0 7px #fff,
    0 0 10px #fff,
    0 0 21px #fff,
    0 0 42px var(--primary-500),
    0 0 82px var(--primary-500),
    0 0 92px var(--primary-500);
}

.neon-glow {
  box-shadow: 
    0 0 5px var(--primary-500),
    0 0 10px var(--primary-500),
    0 0 20px var(--primary-500),
    0 0 40px var(--primary-500);
}

/* ========== 响应式调整 ========== */
@media (max-width: 768px) {
  .masonry { column-count: 2; }
  .circular-progress { width: 100px; height: 100px; }
  .circular-progress-value { font-size: 22px; }
  .flip-digit { width: 26px; height: 36px; font-size: 18px; }
}
