/* 公共样式库 - 整合了toast和footer样式 */
/* Toast 通知样式 */
.toast {
    position: fixed;
    top: 50%;
    left: 50%;
    background: linear-gradient(135deg, #60a5fa, #3b82f6);
    color: white;
    padding: 16px 24px;
    border-radius: 12px;
    box-shadow: 0 8px 24px rgba(59, 130, 246, 0.2);
    font-size: 15px;
    font-weight: 500;
    z-index: 1000;
    max-width: 350px;
    transform: translate(-50%, -50%) translateX(120%);
    transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
    border-left: 4px solid #3b82f6;
    display: flex;
    align-items: center;
    gap: 12px;
    overflow: hidden;
    pointer-events: auto;
}

.toast.show {
    transform: translate(-50%, -50%) translateX(0);
}

/* Toast 类型样式 */
.toast-success {
    border-left-color: #22c55e;
    background: linear-gradient(135deg, #10b981, #22c55e);
    color: white;
    box-shadow: 0 8px 24px rgba(16, 185, 129, 0.2);
    display: flex !important;
    flex-direction: column !important;
    align-items: flex-start !important;
    padding: 20px !important;
    max-width: 400px !important;
}

.toast-confirm-btn {
    border-left-color: #3b82f6;
    background: linear-gradient(135deg, #4f46e5, #4338ca);
    color: white;
    box-shadow: 0 15px 30px rgba(79, 70, 229, 0.4);
    display: flex !important;
    flex-direction: column !important;
    align-items: center !important;
    text-align: center;
    padding: 30px !important;
    max-width: 420px !important;
    border-radius: 20px !important;
    border-left: none !important;
    border: 1px solid rgba(255, 255, 255, 0.2);
    backdrop-filter: blur(12px);
    transform: translate(-50%, -50%) scale(1);
    transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.toast-confirm:hover {
    transform: translate(-50%, -50%) scale(1.02);
    box-shadow: 0 20px 35px rgba(79, 70, 229, 0.5);
}

.toast-error {
    border-left-color: #ef4444;
    background: linear-gradient(135deg, #f87171, #ef4444);
    color: white;
    box-shadow: 0 8px 24px rgba(239, 68, 68, 0.2);
}

.toast-warning {
    border-left-color: #f59e0b;
    background: linear-gradient(135deg, #fbbf24, #f59e0b);
    color: white;
    box-shadow: 0 8px 24px rgba(245, 158, 11, 0.2);
}

.toast-info {
    border-left-color: #3b82f6;
    background: linear-gradient(135deg, #60a5fa, #3b82f6);
    color: white;
    box-shadow: 0 8px 24px rgba(59, 130, 246, 0.2);
}

/* Toast 图标 */
.toast::before {
    content: '';
    display: inline-block;
    width: 24px;
    height: 24px;
    background-size: contain;
    background-repeat: no-repeat;
    background-position: center;
}

.toast-success::before {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='white'%3E%3Cpath d='M9 16.17L4.83 12l-1.42 1.41L9 19 21 7l-1.41-1.41z'/%3E%3C/svg%3E");
}

.toast-error::before {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='white'%3E%3Cpath d='M19 6.41L17.59 5 12 10.59 6.41 5 5 6.41 10.59 12 5 17.59 6.41 19 12 13.41 17.59 19 19 17.59 13.41 12z'/%3E%3C/svg%3E");
}

.toast-warning::before {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='%232D3436'%3E%3Cpath d='M1 21h22L12 2 1 21zm12-3h-2v-2h2v2zm0-4h-2v-4h2v4z'/%3E%3C/svg%3E");
}

.toast-info::before {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='white'%3E%3Cpath d='M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2zm1 15h-2v-6h2v6zm0-8h-2V7h2v2z'/%3E%3C/svg%3E");
}

/* Toast 动画 */
@keyframes slideIn {
    from {
        transform: translateX(100%);
        opacity: 0;
    }

    to {
        transform: translateX(0);
        opacity: 1;
    }
}

@keyframes slideOut {
    from {
        transform: translateX(0);
        opacity: 1;
    }

    to {
        transform: translateX(100%);
        opacity: 0;
    }
}

.toast {
    animation: slideIn 0.3s ease-out;
}

.toast.hiding {
    animation: slideOut 0.3s ease-in;
}

/* 移动端适配 */
@media (max-width: 480px) {
    .toast {
        top: 10px;
        right: 10px;
        left: 10px;
        max-width: none;
        transform: translateY(-100%);
    }

    .toast.show {
        transform: translateY(0);
    }

    @keyframes slideIn {
        from {
            transform: translateY(-100%);
            opacity: 0;
        }

        to {
            transform: translateY(0);
            opacity: 1;
        }
    }

    @keyframes slideOut {
        from {
            transform: translateY(0);
            opacity: 1;
        }

        to {
            transform: translateY(-100%);
            opacity: 0;
        }
    }
}

/* Toast 堆叠效果 */
.toast+.toast {
    margin-top: 10px;
}

/* Toast 确认框按钮 */
.toast-buttons {
    display: flex;
    justify-content: center;
    gap: 20px;
    margin-top: 24px;
    width: 100%;
    padding-top: 20px;
    border-top: 1px solid rgba(255, 255, 255, 0.15);
}

.toast-btn {
    padding: 12px 28px;
    border: none;
    border-radius: 50px;
    font-weight: 600;
    font-size: 15px;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.15);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.toast-cancel {
    background-color: rgba(255, 255, 255, 0.2);
    color: white;
}

.toast-cancel:hover {
    background-color: rgba(255, 255, 255, 0.3);
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.2);
}

.toast-confirm {
    background-color: white;
    color: #4338ca;
    font-weight: 700;
}

.toast-confirm:hover {
    background-color: #f8fafc;
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.2);
}

.toast-cancel {
    background: rgba(255, 255, 255, 0.15);
    color: white;
}

.toast-cancel:hover {
    background: rgba(255, 255, 255, 0.25);
    transform: translateY(-2px);
}

.toast-confirm {
    border-left-color: #7c3aed;
    background: linear-gradient(135deg, #8b5cf6, #7c3aed);
    color: white;
    box-shadow: 0 15px 30px rgba(124, 58, 237, 0.4);
    display: flex !important;
    flex-direction: column !important;
    align-items: center !important;
    text-align: center;
    padding: 30px !important;
    max-width: 420px !important;
    border-radius: 20px !important;
    border-left: none !important;
    border: 1px solid rgba(255, 255, 255, 0.2);
    backdrop-filter: blur(12px);
    transform: translate(-50%, -50%) scale(1);
    transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.toast-confirm:hover {
    transform: translate(-50%, -50%) scale(1.02);
    box-shadow: 0 20px 35px rgba(124, 58, 237, 0.5);
}

.toast-confirm .toast-btn {
    background: white;
    color: #7c3aed;
    font-weight: 600;
}

.toast-confirm .toast-btn:hover {
    background: #f9f5ff;
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(124, 58, 237, 0.3);
}

.toast-confirm:hover {
    background: #f0f9ff;
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(59, 130, 246, 0.2);
}

.toast-confirm {
    /* background: white; */
    color: #3b82f6;
}

.toast-confirm:hover {
    background: rgba(255, 255, 255, 0.9);
}

/* Toast 关闭按钮 */
.toast-close {
    position: absolute;
    top: 12px;
    right: 12px;
    width: 24px;
    height: 24px;
    border: none;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 50%;
    cursor: pointer;
    opacity: 0.7;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.toast-close:hover {
    opacity: 1;
    background: rgba(255, 255, 255, 0.3);
}

.toast-close::before,
.toast-close::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 14px;
    height: 2px;
    background: white;
    transform: translate(-50%, -50%) rotate(45deg);
}

.toast-close::after {
    transform: translate(-50%, -50%) rotate(-45deg);
}

/* Toast 进度条 */
.toast-progress {
    position: absolute;
    bottom: 0;
    left: 0;
    height: 4px;
    background: rgba(255, 255, 255, 0.5);
    width: 100%;
    transition: width 0.3s linear;
    background: rgba(255, 255, 255, 0.6);
    border-radius: 0 0 12px 12px;
    animation: progress 3s cubic-bezier(0.4, 0, 0.2, 1);
}

@keyframes progress {
    from {
        width: 100%;
    }

    to {
        width: 0%;
    }
}

/* 确认框按钮容器 */
.toast-buttons {
    display: flex !important;
    /* justify-content: flex-end !important; */
    width: 100% !important;
    margin-top: 16px !important;
    gap: 10px !important;
    opacity: 1 !important;
    visibility: visible !important;
    position: relative !important;
    z-index: 1002 !important;
}

/* 确认框按钮样式 */
.toast-cancel,
.toast-confirm {
    padding: 8px 16px !important;
    color: white !important;
    border: none !important;
    border-radius: 6px !important;
    cursor: pointer !important;
    font-weight: 500 !important;
    display: inline-block !important;
    min-width: 80px !important;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2) !important;
    /* position: relative !important; */
    z-index: 1003 !important;
}

.toast-cancel {
    background-color: #64748b !important;
}

.toast-confirm {
    background-color: #22c55e !important;
}
/* 底部导航样式 */
.bottom-nav {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: white;
    display: flex;
    box-shadow: 0 -2px 10px rgba(0,0,0,0.1);
    z-index: 100;
    height: 65px;
}

.nav-item {
    flex: 1;
    text-align: center;
    padding: 8px 0;
    color: #666;
    font-size: 12px;
    transition: all 0.3s;
}

.nav-item.active {
    color: var(--primary);
}

.nav-icon {
    font-size: 22px;
    margin-bottom: 4px;
}
/* 任务完成动画 */
@keyframes taskComplete {
    0% { transform: scale(0.8); opacity: 0.8; }
    50% { transform: scale(1.2); opacity: 1; }
    100% { transform: scale(1); opacity: 1; }
}

/* 积分更新动画 */
@keyframes scoreUpdate {
    0% { transform: scale(1); }
    50% { transform: scale(1.5); color: #f59e0b; }
    100% { transform: scale(1); }
}

/* 任务进行中动画 */
.task-completing {
    position: relative;
}

.task-completing::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 20px;
    height: 20px;
    margin: -10px 0 0 -10px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    border-top-color: white;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* 新增的中心悬浮按钮 */
.nav-main {
    position: absolute;
    left: 50%;
    top: -25px;
    transform: translateX(-50%);
    width: 60px;
    height: 60px;
    border-radius: 30px;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    display: flex;
    justify-content: center;
    align-items: center;
    box-shadow: 0 4px 20px rgba(108, 92, 231, 0.3);
    z-index: 101;
    transition: all 0.3s;
}

.nav-main:active {
    transform: translateX(-50%) scale(0.95);
}

.nav-icon-main {
    position: relative;
    color: white;
    font-size: 24px;
}

.pulse-effect {
    position: absolute;
    width: 100%;
    height: 100%;
    border-radius: 50%;
    background: rgba(255,255,255,0.2);
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0% { transform: scale(0.8); opacity: 0.8; }
    70% { transform: scale(1.3); opacity: 0; }
    100% { opacity: 0; }
}