/* src/main/resources/static/css/main.css */

/* 全局背景色过渡，让黑白切换更丝滑 */
body {
  transition: background-color 0.3s ease, color 0.3s ease;
}

/* 隐藏滚动条 */
.no-scrollbar::-webkit-scrollbar {
  display: none;
}
.no-scrollbar {
  -ms-overflow-style: none;
  scrollbar-width: none;
}

/* 动态网格背景：自动适配明暗模式 */
.bg-grid-pattern {
  background-image: linear-gradient(to right, rgba(9, 9, 11, 0.03) 1px, transparent 1px),
  linear-gradient(to bottom, rgba(9, 9, 11, 0.03) 1px, transparent 1px);
  background-size: 32px 32px;
}

.dark .bg-grid-pattern {
  background-image: linear-gradient(to right, rgba(16, 185, 129, 0.02) 1px, transparent 1px),
  linear-gradient(to bottom, rgba(16, 185, 129, 0.02) 1px, transparent 1px);
}

/* 极光微光动画 */
@keyframes pulse-glow {
  0%, 100% { transform: scale(1) translate(0, 0); opacity: 0.12; }
  50% { transform: scale(1.15) translate(5%, 2%); opacity: 0.22; }
}
.animate-glow {
  animation: pulse-glow 12s ease-in-out infinite;
}

/* 玻璃拟态卡片效果 */
.glass-card {
  background: rgba(255, 255, 255, 0.7);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid rgba(9, 9, 11, 0.05);
}

.dark .glass-card {
  background: rgba(9, 9, 11, 0.5);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid rgba(255, 255, 255, 0.04);
}

/* 交互过渡与微动画 */
.transition-all-300 {
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* 行级淡出动画 */
.fade-out {
  opacity: 0;
  transform: scale(0.95) translateY(-8px);
  transition: opacity 0.4s ease, transform 0.4s ease, margin-top 0.4s ease, height 0.4s ease, padding 0.4s ease;
  height: 0 !important;
  padding-top: 0 !important;
  padding-bottom: 0 !important;
  margin-top: 0 !important;
  margin-bottom: 0 !important;
  overflow: hidden;
  border-width: 0 !important;
}

/* 轻量 Toast 样式 */
#toast-container {
  position: fixed;
  top: 1.5rem;
  right: 1.5rem;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  pointer-events: none;
}

.toast-message {
  background: rgba(9, 9, 11, 0.9);
  color: #fff;
  border: 1px solid rgba(255, 255, 255, 0.1);
  backdrop-filter: blur(8px);
  padding: 0.75rem 1.25rem;
  border-radius: 0.75rem;
  font-size: 0.875rem;
  font-weight: 500;
  box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.3), 0 4px 6px -4px rgba(0, 0, 0, 0.3);
  opacity: 0;
  transform: translateY(-10px);
  transition: opacity 0.3s ease, transform 0.3s ease;
  pointer-events: auto;
}

.dark .toast-message {
  background: rgba(255, 255, 255, 0.95);
  color: #09090b;
  border: 1px solid rgba(9, 9, 11, 0.1);
}

.toast-message.show {
  opacity: 1;
  transform: translateY(0);
}

/* 输入框为空时的震动动效 */
@keyframes shake {
  0%, 100% { transform: translateX(0); }
  20%, 60% { transform: translateX(-6px); }
  40%, 80% { transform: translateX(6px); }
}
.animate-shake {
  animation: shake 0.3s ease-in-out;
  border-color: #ef4444 !important;
  box-shadow: 0 0 0 4px rgba(239, 68, 68, 0.15) !important;
}

/* 时间续期成功的闪烁绿色高亮 */
@keyframes flash-green {
  0%, 100% { color: inherit; }
  50% { color: #10b981; filter: drop-shadow(0 0 4px rgba(16, 185, 129, 0.5)); transform: scale(1.02); }
}
.animate-flash-green {
  display: inline-block;
  animation: flash-green 1s ease-in-out;
}

/* 二维码卡片呼吸发光效果 */
.qr-glow {
  box-shadow: 0 0 0px 0px rgba(16, 185, 129, 0);
  transition: box-shadow 0.3s ease;
}
.qr-glow:hover {
  box-shadow: 0 0 20px 2px rgba(16, 185, 129, 0.15);
}

/* 帮助 Modal 遮罩层 */
.modal-overlay {
  background: rgba(9, 9, 11, 0.4);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  transition: opacity 0.3s ease;
}

/* 登录面板滑入滑出 */
.slide-container {
  display: flex;
  width: 200%;
  transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.slide-pane {
  width: 50%;
  flex-shrink: 0;
  transition: opacity 0.3s ease;
}

/* 页面切换苹果风平滑转场动画 */
@keyframes apple-page-enter {
  from {
    opacity: 0;
    transform: scale(0.99) translateY(4px);
  }
  to {
    opacity: 1;
    transform: scale(1) translateY(0);
  }
}

.apple-transition-enter {
  animation: apple-page-enter 0.25s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

@keyframes apple-page-exit {
  from {
    opacity: 1;
    transform: scale(1) translateY(0);
  }
  to {
    opacity: 0;
    transform: scale(0.99) translateY(-4px);
  }
}

.apple-transition-exit {
  animation: apple-page-exit 0.15s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

@keyframes clip-path-spread {
  from {
    clip-path: circle(0px at var(--clip-x, 0px) var(--clip-y, 0px));
  }
  to {
    clip-path: circle(var(--clip-radius, 1000px) at var(--clip-x, 0px) var(--clip-y, 0px));
  }
}

/* 主题波纹切换特有的 view-transition 层级控制 */
::view-transition-old(root),
::view-transition-new(root) {
  animation: none;
  mix-blend-mode: normal;
}

::view-transition-old(root) {
  z-index: 1;
}

::view-transition-new(root) {
  z-index: 9999;
  animation: 400ms cubic-bezier(0.4, 0, 0.2, 1) clip-path-spread forwards;
}



