/* ============================================
   云卡栈 - 高级感UI系统 v6.0
   新增20项深度优化（第61-80项）
   ============================================ */

/* ========== 61. 水波纹按钮 ========== */
.water-ripple-btn {
  position: relative;
  overflow: hidden;
}

.water-ripple {
  position: absolute;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.5);
  transform: scale(0);
  animation: waterRipple 0.8s ease-out;
  pointer-events: none;
}

@keyframes waterRipple {
  to { transform: scale(4); opacity: 0; }
}

/* ========== 62. 鼠标跟随光效 ========== */
.mouse-glow-container {
  position: relative;
  overflow: hidden;
}

.mouse-glow {
  position: absolute;
  width: 300px;
  height: 300px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(102, 126, 234, 0.15), transparent 70%);
  pointer-events: none;
  transform: translate(-50%, -50%);
  transition: opacity 0.3s ease;
  z-index: 0;
}

/* ========== 63. 渐变文字效果 ========== */
.gradient-text {
  background: var(--gradient-primary);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  color: transparent;
}

.gradient-text-shimmer {
  background: linear-gradient(90deg, #667eea, #764ba2, #f093fb, #667eea);
  background-size: 200% auto;
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  color: transparent;
  animation: textShimmer 3s linear infinite;
}

@keyframes textShimmer {
  to { background-position: 200% center; }
}

/* ========== 64. 文字逐字显现 ========== */
.char-reveal {
  display: inline-block;
}

.char-reveal span {
  display: inline-block;
  opacity: 0;
  transform: translateY(20px);
  animation: charReveal 0.5s ease forwards;
}

@keyframes charReveal {
  to { opacity: 1; transform: translateY(0); }
}

/* ========== 65. 输入框聚焦光效 ========== */
.glow-input {
  position: relative;
}

.glow-input input,
.glow-input textarea {
  width: 100%;
  padding: 12px 16px;
  font-size: 16px;
  border: 1.5px solid var(--border-light);
  border-radius: 12px;
  background: var(--bg-card);
  color: var(--text-primary);
  outline: none;
  transition: all 0.3s ease;
}

.glow-input input:focus,
.glow-input textarea:focus {
  border-color: var(--primary-400);
  box-shadow: 0 0 0 4px rgba(59, 130, 246, 0.1), 0 0 20px rgba(59, 130, 246, 0.15);
}

/* ========== 66. 复选框打勾动画 ========== */
.animate-checkbox {
  position: relative;
  width: 24px;
  height: 24px;
  cursor: pointer;
}

.animate-checkbox input {
  opacity: 0;
  position: absolute;
}

.animate-checkbox .checkbox-box {
  width: 24px;
  height: 24px;
  border: 2px solid var(--border-medium);
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.3s ease;
  background: var(--bg-card);
}

.animate-checkbox input:checked + .checkbox-box {
  background: var(--gradient-primary);
  border-color: transparent;
}

.animate-checkbox .checkmark {
  width: 12px;
  height: 6px;
  border-left: 2px solid white;
  border-bottom: 2px solid white;
  transform: rotate(-45deg) scale(0);
  transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
  margin-top: -3px;
}

.animate-checkbox input:checked + .checkbox-box .checkmark {
  transform: rotate(-45deg) scale(1);
}

/* ========== 67. 单选按钮动画 ========== */
.animate-radio {
  position: relative;
  width: 24px;
  height: 24px;
  cursor: pointer;
}

.animate-radio input {
  opacity: 0;
  position: absolute;
}

.animate-radio .radio-box {
  width: 24px;
  height: 24px;
  border: 2px solid var(--border-medium);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.3s ease;
  background: var(--bg-card);
}

.animate-radio input:checked + .radio-box {
  border-color: var(--primary-500);
}

.animate-radio .radio-dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--gradient-primary);
  transform: scale(0);
  transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.animate-radio input:checked + .radio-box .radio-dot {
  transform: scale(1);
}

/* ========== 68. 卡片左滑操作 ========== */
.swipe-card {
  position: relative;
  overflow: hidden;
  touch-action: pan-y;
}

.swipe-card-content {
  position: relative;
  background: var(--bg-card);
  z-index: 1;
  transition: transform 0.3s ease;
  padding: 16px;
}

.swipe-card-actions {
  position: absolute;
  right: 0;
  top: 0;
  bottom: 0;
  display: flex;
  transform: translateX(100%);
}

.swipe-card-action {
  width: 70px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  color: white;
  font-size: 12px;
  cursor: pointer;
}

.swipe-card-action.delete { background: var(--danger); }
.swipe-card-action.favorite { background: var(--warning); }
.swipe-card-action.edit { background: var(--primary-500); }

.swipe-card.swiped .swipe-card-content {
  transform: translateX(-140px);
}

/* ========== 69. 页面加载进度条 ========== */
.page-loading-bar {
  position: fixed;
  top: 0;
  left: 0;
  height: 3px;
  background: var(--gradient-primary);
  z-index: 10000;
  transition: width 0.3s ease;
  box-shadow: 0 0 10px rgba(102, 126, 234, 0.5);
}

/* ========== 70. 滚动吸附效果 ========== */
.snap-container {
  scroll-snap-type: x mandatory;
  overflow-x: auto;
  display: flex;
  gap: 16px;
  padding: 16px;
  scrollbar-width: none;
}

.snap-container::-webkit-scrollbar {
  display: none;
}

.snap-item {
  scroll-snap-align: start;
  flex-shrink: 0;
}

/* ========== 71. 侧边抽屉动画 ========== */
.drawer-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.5);
  backdrop-filter: blur(4px);
  z-index: 3500;
  opacity: 0;
  visibility: hidden;
  transition: all 0.3s ease;
}

.drawer-overlay.open {
  opacity: 1;
  visibility: visible;
}

.drawer {
  position: fixed;
  top: 0;
  bottom: 0;
  width: 85%;
  max-width: 360px;
  background: var(--bg-card);
  z-index: 3501;
  transform: translateX(-100%);
  transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: var(--shadow-2xl);
  overflow-y: auto;
}

.drawer.right {
  right: 0;
  transform: translateX(100%);
}

.drawer.open {
  transform: translateX(0);
}

.drawer-header {
  padding: 20px;
  border-bottom: 1px solid var(--border-light);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

/* ========== 72. 底部弹出层 ========== */
.bottom-sheet-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.5);
  backdrop-filter: blur(4px);
  z-index: 3500;
  opacity: 0;
  visibility: hidden;
  transition: all 0.3s ease;
}

.bottom-sheet-overlay.open {
  opacity: 1;
  visibility: visible;
}

.bottom-sheet {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background: var(--bg-card);
  border-radius: 24px 24px 0 0;
  z-index: 3501;
  transform: translateY(100%);
  transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  max-height: 80vh;
  overflow-y: auto;
}

.bottom-sheet.open {
  transform: translateY(0);
}

.bottom-sheet-handle {
  width: 40px;
  height: 4px;
  background: var(--bg-tertiary);
  border-radius: 2px;
  margin: 12px auto;
}

/* ========== 73. 高级时间轴 ========== */
.premium-timeline {
  position: relative;
  padding-left: 40px;
}

.premium-timeline::before {
  content: '';
  position: absolute;
  left: 15px;
  top: 0;
  bottom: 0;
  width: 2px;
  background: linear-gradient(to bottom, var(--primary-400), var(--bg-tertiary));
}

.premium-timeline-item {
  position: relative;
  padding-bottom: 24px;
}

.premium-timeline-item:last-child {
  padding-bottom: 0;
}

.premium-timeline-icon {
  position: absolute;
  left: -33px;
  top: 0;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--gradient-primary);
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-size: 14px;
  box-shadow: 0 0 0 4px var(--bg-primary), 0 4px 12px rgba(102, 126, 234, 0.3);
}

.premium-timeline-content {
  background: var(--bg-card);
  border-radius: var(--radius-md);
  padding: 16px;
  box-shadow: var(--shadow-sm);
}

/* ========== 74. 高级轮播图（3D缩放） ========== */
.carousel-3d {
  perspective: 1200px;
  overflow: hidden;
  padding: 20px 0;
}

.carousel-3d-track {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 20px;
  transition: transform 0.5s ease;
}

.carousel-3d-item {
  width: 280px;
  flex-shrink: 0;
  transition: all 0.5s ease;
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-lg);
}

.carousel-3d-item.active {
  transform: scale(1);
  z-index: 2;
}

.carousel-3d-item.prev,
.carousel-3d-item.next {
  transform: scale(0.85);
  opacity: 0.6;
  z-index: 1;
}

.carousel-3d-item.hidden {
  transform: scale(0.7);
  opacity: 0;
}

/* ========== 75. 高级评分组件 ========== */
.premium-rating {
  display: flex;
  align-items: center;
  gap: 8px;
}

.premium-rating-stars {
  display: flex;
  gap: 4px;
  cursor: pointer;
}

.premium-rating-star {
  width: 28px;
  height: 28px;
  color: var(--bg-tertiary);
  transition: all 0.2s ease;
  position: relative;
}

.premium-rating-star.filled {
  color: #fbbf24;
  filter: drop-shadow(0 0 4px rgba(251, 191, 36, 0.5));
}

.premium-rating-star:hover {
  transform: scale(1.2);
}

.premium-rating-emoji {
  font-size: 24px;
  transition: all 0.3s ease;
}

/* ========== 76. 脉冲光环效果 ========== */
.pulse-ring {
  position: relative;
}

.pulse-ring::before {
  content: '';
  position: absolute;
  inset: -4px;
  border-radius: inherit;
  border: 2px solid var(--primary-400);
  animation: pulseRing 2s ease-out infinite;
}

@keyframes pulseRing {
  0% { transform: scale(1); opacity: 1; }
  100% { transform: scale(1.3); opacity: 0; }
}

/* ========== 77. 彩虹流动边框 ========== */
.rainbow-border {
  position: relative;
  border-radius: var(--radius-lg);
  background: var(--bg-card);
  z-index: 0;
}

.rainbow-border::before {
  content: '';
  position: absolute;
  inset: -2px;
  border-radius: inherit;
  background: linear-gradient(90deg, #ff0000, #ff7f00, #ffff00, #00ff00, #0000ff, #4b0082, #9400d3, #ff0000);
  background-size: 400% 100%;
  animation: rainbowFlow 4s linear infinite;
  z-index: -1;
}

@keyframes rainbowFlow {
  0% { background-position: 0% 50%; }
  100% { background-position: 400% 50%; }
}

/* ========== 78. 按钮弹性反馈 ========== */
.elastic-btn {
  transition: transform 0.15s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.elastic-btn:active {
  transform: scale(0.92);
}

.elastic-btn:active::after {
  content: '';
  position: absolute;
  inset: 0;
  background: rgba(255,255,255,0.2);
  border-radius: inherit;
}

/* ========== 79. 标签删除动画 ========== */
.removable-tag {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  background: var(--primary-50);
  color: var(--primary-700);
  border-radius: 16px;
  font-size: 13px;
  transition: all 0.3s ease;
  animation: tagIn 0.3s ease;
}

.removable-tag.removing {
  animation: tagOut 0.3s ease forwards;
}

@keyframes tagIn {
  from { opacity: 0; transform: scale(0.8); }
  to { opacity: 1; transform: scale(1); }
}

@keyframes tagOut {
  to { opacity: 0; transform: scale(0.5); margin: 0; padding: 0; }
}

.removable-tag-close {
  cursor: pointer;
  opacity: 0.6;
  transition: opacity 0.2s;
  font-size: 16px;
  line-height: 1;
}

.removable-tag-close:hover {
  opacity: 1;
}

/* ========== 80. 磨砂玻璃弹窗 ========== */
.frosted-modal {
  background: rgba(255, 255, 255, 0.7);
  backdrop-filter: blur(20px) saturate(180%);
  -webkit-backdrop-filter: blur(20px) saturate(180%);
  border: 1px solid rgba(255, 255, 255, 0.5);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
}

@media (prefers-color-scheme: dark) {
  .frosted-modal {
    background: rgba(26, 26, 26, 0.7);
    border: 1px solid rgba(255, 255, 255, 0.1);
  }
}

/* ========== 响应式 ========== */
@media (max-width: 768px) {
  .carousel-3d-item {
    width: 240px;
  }
  
  .drawer {
    width: 90%;
  }
}
