/* ========== 推荐系统增强样式 ========== */

/* 复制成功动画 */
@keyframes copySuccess {
    0% {
        transform: scale(1);
        opacity: 1;
    }
    50% {
        transform: scale(1.1);
    }
    100% {
        transform: scale(1);
        opacity: 1;
    }
}

@keyframes slideInUp {
    from {
        transform: translateY(10px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

/* 增强的复制按钮 */
.copy-btn {
    position: relative;
    overflow: hidden;
}

.copy-btn.copied {
    animation: copySuccess 0.6s ease;
}

.copy-btn.copied::after {
    content: '✓ 已复制';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: rgba(16, 185, 129, 0.95);
    color: white;
    padding: 0.5rem 1rem;
    border-radius: 8px;
    font-size: 0.85rem;
    font-weight: 600;
    white-space: nowrap;
    animation: slideInUp 0.3s ease;
    z-index: 10;
}

/* 分享按钮组 */
.share-buttons {
    display: flex;
    gap: 0.75rem;
    margin-top: 1rem;
    flex-wrap: wrap;
}

.share-btn {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1.25rem;
    border-radius: 12px;
    border: 1px solid rgba(99, 102, 241, 0.2);
    background: rgba(99, 102, 241, 0.05);
    color: white;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 0.9rem;
    font-weight: 500;
}

.share-btn:hover {
    background: rgba(99, 102, 241, 0.15);
    border-color: rgba(99, 102, 241, 0.4);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.2);
}

.share-btn svg {
    width: 18px;
    height: 18px;
    fill: currentColor;
}

/* 推荐收益计算器 */
.referral-calculator {
    background: linear-gradient(135deg,
        rgba(99, 102, 241, 0.1),
        rgba(139, 92, 246, 0.1));
    border: 2px solid rgba(99, 102, 241, 0.2);
    border-radius: 16px;
    padding: 1.5rem;
    margin-top: 1.5rem;
}

.calculator-header {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 1.25rem;
}

.calculator-icon {
    font-size: 1.75rem;
    filter: drop-shadow(0 0 8px rgba(99, 102, 241, 0.6));
}

.calculator-title {
    font-size: 1.1rem;
    font-weight: 700;
    background: linear-gradient(135deg, #6366f1, #8b5cf6);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.calculator-inputs {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
    margin-bottom: 1.25rem;
}

.calc-input-group {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.calc-label {
    font-size: 0.85rem;
    color: rgba(255, 255, 255, 0.7);
    font-weight: 500;
}

.calc-input-wrapper {
    position: relative;
}

.calc-input {
    width: 100%;
    padding: 0.75rem 1rem;
    background: rgba(20, 20, 30, 0.6);
    border: 1px solid rgba(99, 102, 241, 0.3);
    border-radius: 10px;
    color: white;
    font-size: 0.95rem;
    transition: all 0.3s ease;
}

.calc-input:focus {
    outline: none;
    border-color: rgba(99, 102, 241, 0.6);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
}

.calc-input-suffix {
    position: absolute;
    right: 1rem;
    top: 50%;
    transform: translateY(-50%);
    color: rgba(255, 255, 255, 0.5);
    font-size: 0.85rem;
    font-weight: 600;
    pointer-events: none;
}

.calculator-result {
    background: rgba(30, 30, 45, 0.8);
    border: 1px solid rgba(99, 102, 241, 0.3);
    border-radius: 12px;
    padding: 1.25rem;
}

.result-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 1rem;
}

.result-item {
    text-align: center;
}

.result-label {
    font-size: 0.8rem;
    color: rgba(255, 255, 255, 0.6);
    margin-bottom: 0.5rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.result-value {
    font-size: 1.5rem;
    font-weight: 700;
    background: linear-gradient(135deg, #10b981, #059669);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.result-value.tier2 {
    background: linear-gradient(135deg, #8b5cf6, #a78bfa);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.result-value.total {
    font-size: 1.75rem;
    background: linear-gradient(135deg, #fbbf24, #f59e0b);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* 推荐排行榜 */
.referral-leaderboard {
    background: rgba(20, 20, 30, 0.6);
    border: 1px solid rgba(99, 102, 241, 0.2);
    border-radius: 16px;
    padding: 1.5rem;
    margin-top: 2rem;
}

.leaderboard-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1.25rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid rgba(99, 102, 241, 0.2);
}

.leaderboard-title {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.leaderboard-icon {
    font-size: 1.75rem;
}

.leaderboard-title h3 {
    font-size: 1.1rem;
    font-weight: 700;
}

.leaderboard-refresh {
    padding: 0.5rem 1rem;
    background: rgba(99, 102, 241, 0.1);
    border: 1px solid rgba(99, 102, 241, 0.3);
    border-radius: 8px;
    color: white;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 0.85rem;
}

.leaderboard-refresh:hover {
    background: rgba(99, 102, 241, 0.2);
    transform: translateY(-2px);
}

.leaderboard-list {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.leaderboard-item {
    display: grid;
    grid-template-columns: 50px 1fr 120px 120px;
    align-items: center;
    gap: 1rem;
    padding: 1rem;
    background: rgba(30, 30, 45, 0.4);
    border: 1px solid rgba(99, 102, 241, 0.15);
    border-radius: 12px;
    transition: all 0.3s ease;
}

.leaderboard-item:hover {
    background: rgba(30, 30, 45, 0.6);
    border-color: rgba(99, 102, 241, 0.3);
    transform: translateX(4px);
}

.leaderboard-item.top-1 {
    background: linear-gradient(135deg,
        rgba(255, 215, 0, 0.1),
        rgba(255, 193, 7, 0.1));
    border-color: rgba(255, 215, 0, 0.4);
}

.leaderboard-item.top-2 {
    background: linear-gradient(135deg,
        rgba(192, 192, 192, 0.1),
        rgba(169, 169, 169, 0.1));
    border-color: rgba(192, 192, 192, 0.4);
}

.leaderboard-item.top-3 {
    background: linear-gradient(135deg,
        rgba(205, 127, 50, 0.1),
        rgba(184, 115, 51, 0.1));
    border-color: rgba(205, 127, 50, 0.4);
}

.leaderboard-rank {
    text-align: center;
    font-size: 1.25rem;
    font-weight: 700;
    color: rgba(255, 255, 255, 0.6);
}

.leaderboard-item.top-1 .leaderboard-rank {
    color: #ffd700;
    font-size: 1.5rem;
}

.leaderboard-item.top-2 .leaderboard-rank {
    color: #c0c0c0;
    font-size: 1.4rem;
}

.leaderboard-item.top-3 .leaderboard-rank {
    color: #cd7f32;
    font-size: 1.3rem;
}

.leaderboard-address {
    font-family: 'Courier New', monospace;
    font-size: 0.9rem;
    color: rgba(255, 255, 255, 0.8);
}

.leaderboard-stats {
    text-align: right;
    font-size: 0.85rem;
}

.leaderboard-team {
    color: rgba(99, 102, 241, 0.9);
    font-weight: 600;
}

.leaderboard-rewards {
    text-align: right;
    font-weight: 700;
    background: linear-gradient(135deg, #10b981, #059669);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* 推荐进度条 */
.referral-progress {
    margin-top: 1.5rem;
}

.progress-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.75rem;
}

.progress-label {
    font-size: 0.9rem;
    color: rgba(255, 255, 255, 0.7);
}

.progress-value {
    font-weight: 700;
    color: #6366f1;
}

.progress-bar-wrapper {
    height: 12px;
    background: rgba(30, 30, 45, 0.6);
    border-radius: 10px;
    overflow: hidden;
    position: relative;
}

.progress-bar {
    height: 100%;
    background: linear-gradient(90deg, #6366f1, #8b5cf6);
    border-radius: 10px;
    transition: width 1s ease;
    position: relative;
}

.progress-bar::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(90deg,
        transparent,
        rgba(255, 255, 255, 0.3),
        transparent);
    animation: shimmer 2s infinite;
}

@keyframes shimmer {
    0% {
        transform: translateX(-100%);
    }
    100% {
        transform: translateX(100%);
    }
}

/* Toast 通知 */
.toast-notification {
    position: fixed;
    top: 20px;
    right: 20px;
    padding: 1rem 1.5rem;
    background: rgba(16, 185, 129, 0.95);
    color: white;
    border-radius: 12px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
    z-index: 10000;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    animation: slideInRight 0.3s ease, fadeOut 0.3s ease 2.7s;
}

.toast-notification.error {
    background: rgba(239, 68, 68, 0.95);
}

.toast-notification.info {
    background: rgba(99, 102, 241, 0.95);
}

@keyframes slideInRight {
    from {
        transform: translateX(400px);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

@keyframes fadeOut {
    to {
        opacity: 0;
        transform: translateX(400px);
    }
}

/* 响应式设计 */
@media (max-width: 768px) {
    .calculator-inputs {
        grid-template-columns: 1fr;
    }

    .result-grid {
        grid-template-columns: 1fr;
    }

    .leaderboard-item {
        grid-template-columns: 40px 1fr 90px;
    }

    .leaderboard-stats {
        display: none;
    }

    .share-buttons {
        flex-direction: column;
    }

    .share-btn {
        width: 100%;
        justify-content: center;
    }
}

@media (max-width: 480px) {
    .referral-calculator,
    .referral-leaderboard {
        padding: 1rem;
    }

    .calc-input {
        font-size: 0.85rem;
        padding: 0.625rem 0.875rem;
    }

    .result-value {
        font-size: 1.25rem;
    }

    .result-value.total {
        font-size: 1.5rem;
    }
}
