/* ===================================================================
   🚀 DOPAMINE TECH - 科技动效增强系统
   让每个交互都充满多巴胺的愉悦感
   =================================================================== */

/* ===== 页面入场 ===== */
body {
    animation: pageEnter 0.5s ease-out;
}

@keyframes pageEnter {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

/* ===== 卡片入场动画 ===== */
.card {
    animation: cardSlide 0.4s ease-out backwards;
}

.card:nth-child(1) {
    animation-delay: 0.05s;
}

.card:nth-child(2) {
    animation-delay: 0.1s;
}

.card:nth-child(3) {
    animation-delay: 0.15s;
}

@keyframes cardSlide {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ===== 统计卡片动效 ===== */
.stat-card {
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.stat-card:hover {
    transform: translateY(-6px);
}

.stat-icon {
    animation: iconPop 0.5s cubic-bezier(0.68, -0.55, 0.265, 1.55) backwards;
}

.stat-card:nth-child(1) .stat-icon {
    animation-delay: 0.1s;
}

.stat-card:nth-child(2) .stat-icon {
    animation-delay: 0.15s;
}

.stat-card:nth-child(3) .stat-icon {
    animation-delay: 0.2s;
}

.stat-card:nth-child(4) .stat-icon {
    animation-delay: 0.25s;
}

@keyframes iconPop {
    from {
        opacity: 0;
        transform: scale(0.5);
    }

    to {
        opacity: 1;
        transform: scale(1);
    }
}

/* ===== 按钮交互增强 ===== */
.btn-primary {
    position: relative;
    overflow: hidden;
}

.btn-primary::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 50%;
    transform: translate(-50%, -50%);
    transition: width 0.4s, height 0.4s;
}

.btn-primary:active::after {
    width: 300px;
    height: 300px;
}

/* ===== 支付选项卡片动效 ===== */
.payment-option {
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.payment-option:hover {
    transform: translateY(-4px);
}

.payment-option.selected {
    animation: selectPulse 0.4s ease;
}

@keyframes selectPulse {
    0% {
        transform: scale(1);
    }

    50% {
        transform: scale(1.02);
    }

    100% {
        transform: scale(1);
    }
}

/* ===== 导航项过渡 ===== */
.nav-item {
    position: relative;
}

.nav-item::before {
    content: '';
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 3px;
    height: 0;
    background: var(--primary-gradient);
    border-radius: 0 3px 3px 0;
    transition: height 0.3s ease;
}

.nav-item:hover::before {
    height: 50%;
}

.nav-item.active::before {
    height: 0;
}

/* ===== 表格行悬停 ===== */
tr {
    transition: background-color 0.2s ease;
}

/* ===== 邮箱卡片动效 ===== */
.mailbox-card {
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.mailbox-card:hover {
    transform: translateY(-6px);
}

/* ===== 子邮箱槽位动效 ===== */
.sub-slot {
    transition: all 0.25s ease;
}

.sub-slot:hover {
    transform: scale(1.03);
}

/* ===== 模态框入场 ===== */
.modal-overlay.show .modal {
    animation: modalPop 0.4s cubic-bezier(0.68, -0.55, 0.265, 1.55);
}

@keyframes modalPop {
    from {
        opacity: 0;
        transform: scale(0.9) translateY(20px);
    }

    to {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

/* ===== 关闭按钮旋转 ===== */
.modal-close:hover {
    animation: closeRotate 0.3s ease;
}

@keyframes closeRotate {
    from {
        transform: rotate(0deg);
    }

    to {
        transform: rotate(90deg);
    }
}

/* ===== Logo脉冲 ===== */
.auth-header .logo {
    animation: logoPulse 3s ease-in-out infinite;
}

@keyframes logoPulse {

    0%,
    100% {
        box-shadow: 0 0 30px rgba(139, 92, 246, 0.3);
    }

    50% {
        box-shadow: 0 0 50px rgba(139, 92, 246, 0.5);
    }
}

/* ===== 空状态浮动 ===== */
.empty-state .icon {
    animation: emptyFloat 3s ease-in-out infinite;
}

@keyframes emptyFloat {

    0%,
    100% {
        transform: translateY(0);
    }

    50% {
        transform: translateY(-10px);
    }
}

/* ===== Toast通知 ===== */
.toast.show {
    animation: toastBounce 0.5s cubic-bezier(0.68, -0.55, 0.265, 1.55);
}

@keyframes toastBounce {
    from {
        opacity: 0;
        transform: translateY(-30px) scale(0.9);
    }

    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

/* ===== 钻石显示发光 ===== */
.diamond-display {
    animation: diamondGlow 2s ease-in-out infinite;
}

@keyframes diamondGlow {

    0%,
    100% {
        box-shadow: 0 0 20px rgba(139, 92, 246, 0.3);
    }

    50% {
        box-shadow: 0 0 35px rgba(139, 92, 246, 0.5);
    }
}

/* ===== 快捷操作图标跳动 ===== */
.action-btn:hover span {
    animation: iconBounce 0.4s ease;
}

@keyframes iconBounce {

    0%,
    100% {
        transform: translateY(0);
    }

    50% {
        transform: translateY(-5px);
    }
}

/* ===== 推荐卡片背景动效 ===== */
.referral-card::before {
    animation: bgFloat 8s ease-in-out infinite;
}

@keyframes bgFloat {

    0%,
    100% {
        transform: translate(0, 0);
    }

    50% {
        transform: translate(-20px, 20px);
    }
}

/* ===== 输入框聚焦 ===== */
.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus,
.auth-form input:focus {
    animation: inputFocus 0.3s ease;
}

@keyframes inputFocus {
    from {
        transform: scale(1);
    }

    50% {
        transform: scale(1.01);
    }

    to {
        transform: scale(1);
    }
}

/* ===== 徽章微动 ===== */
.badge {
    transition: transform 0.2s ease;
}

.badge:hover {
    transform: scale(1.05);
}

/* ===== 页面标题入场 ===== */
.page-header h1 {
    animation: titleFade 0.5s ease-out;
}

@keyframes titleFade {
    from {
        opacity: 0;
        transform: translateX(-15px);
    }

    to {
        opacity: 1;
        transform: translateX(0);
    }
}

/* ===== 科技网格动画 ===== */
.auth-page::before {
    animation: gridShift 20s linear infinite;
}

@keyframes gridShift {
    from {
        background-position: 0 0;
    }

    to {
        background-position: 50px 50px;
    }
}

/* ===== 浮动装饰科技感 ===== */
.floating-shapes span {
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.floating-shapes span::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    border-radius: inherit;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.1), transparent);
    pointer-events: none;
}

/* ===== 收款码区域动效 ===== */
.qrcode-item {
    transition: all 0.3s ease;
}

.qrcode-item:hover {
    transform: translateY(-4px);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
}

/* ===== 侧边栏Logo旋转 ===== */
.sidebar-header h2::before {
    display: inline-block;
    animation: logoSpin 10s linear infinite;
}

@keyframes logoSpin {
    from {
        transform: rotate(0deg);
    }

    to {
        transform: rotate(360deg);
    }
}

/* ===== 表单组入场 ===== */
.form-group {
    animation: formFade 0.3s ease-out backwards;
}

.form-group:nth-child(1) {
    animation-delay: 0.05s;
}

.form-group:nth-child(2) {
    animation-delay: 0.1s;
}

.form-group:nth-child(3) {
    animation-delay: 0.15s;
}

.form-group:nth-child(4) {
    animation-delay: 0.2s;
}

@keyframes formFade {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ===== 链接下划线动效 ===== */
a {
    position: relative;
}

a::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    width: 0;
    height: 2px;
    background: currentColor;
    transition: width 0.3s ease;
}

a:hover::after {
    width: 100%;
}

/* ===== 管理员标签页切换 ===== */
.admin-tab {
    transition: all 0.3s ease;
}

.admin-tab.active {
    animation: tabActive 0.3s ease;
}

@keyframes tabActive {
    from {
        transform: scale(0.95);
    }

    to {
        transform: scale(1);
    }
}

/* ===== 减少动画偏好 ===== */
@media (prefers-reduced-motion: reduce) {

    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* ===== 打印优化 ===== */
@media print {

    *,
    *::before,
    *::after {
        animation: none !important;
        transition: none !important;
    }
}