/* SDSF Public Styles - Shared Components Only */

/* ===== Back to Top Button ===== */
.back-to-top {
    position: fixed;
    bottom: 40px;
    right: 40px;
    width: 50px;
    height: 50px;
    background: linear-gradient(135deg, #6366f1 0%, #a855f7 50%, #ec4899 100%);
    border: none;
    border-radius: 12px;
    cursor: pointer;
    z-index: 999;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 20px rgba(99, 102, 241, 0.3);
    transition: all 0.3s ease;
    opacity: 0;
    visibility: hidden;
    transform: translateY(20px);
}

.back-to-top.show {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.back-to-top:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 30px rgba(99, 102, 241, 0.5);
}

.back-to-top svg {
    width: 24px;
    height: 24px;
    fill: white;
}

/* ===== Message Toast ===== */
.message-toast {
    position: fixed;
    top: 30px;
    left: 50%;
    transform: translateX(-50%) translateY(-100px);
    background: rgba(18, 18, 22, 0.95);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    padding: 8px 20px;
    border-radius: 10px;
    color: #ffffff;
    font-weight: 500;
    z-index: 100000;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.6);
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    opacity: 0;
    pointer-events: none;
    font-size: 0.9rem;
    white-space: nowrap;
}

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

.message-toast.error {
    border-color: rgba(239, 68, 68, 0.5);
    background: rgba(239, 68, 68, 0.2);
}

.message-toast.success {
    border-color: rgba(34, 197, 94, 0.5);
    background: rgba(34, 197, 94, 0.2);
}

.message-toast.info {
    border-color: rgba(99, 102, 241, 0.5);
    background: rgba(99, 102, 241, 0.2);
}

/* ===== Responsive ===== */
@media (max-width: 768px) {
    .back-to-top {
        bottom: 20px;
        right: 20px;
        width: 45px;
        height: 45px;
    }

    .back-to-top svg {
        width: 20px;
        height: 20px;
    }

    .message-toast {
        top: 20px;
        padding: 6px 16px;
        font-size: 0.85rem;
        max-width: 90vw;
        white-space: normal;
        text-align: center;
    }
}

/* ===== User Sidebar Shared Component ===== */
.sidebar-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.0);
    backdrop-filter: blur(4px);
    z-index: 999;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.sidebar-overlay.active {
    opacity: 1;
    visibility: visible;
}

.user-sidebar {
    position: fixed;
    top: 0;
    right: 0;
    width: 66.67vw;
    height: 100vh;
    height: 100dvh;
    background: linear-gradient(180deg, rgba(20, 20, 25, 0.98) 0%, rgba(10, 10, 12, 0.98) 100%);
    border-left: 1px solid var(--glass-border);
    z-index: 1000;
    transform: translateX(100%);
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    flex-direction: column;
}

.user-sidebar.active {
    transform: translateX(0);
}

.sidebar-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 24px;
    border-bottom: 1px solid var(--glass-border);
}

.sidebar-header h3 {
    font-size: 1.1rem;
    color: var(--text-primary);
    font-weight: 600;
}

.sidebar-close {
    background: none;
    border: none;
    color: var(--text-secondary);
    font-size: 24px;
    cursor: pointer;
    padding: 4px;
    line-height: 1;
    transition: color 0.2s ease;
}

.sidebar-close:hover {
    color: var(--text-primary);
}

.sidebar-content {
    flex: 1;
    padding: 15px 20px 15px 20px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 24px;
    overflow-y: auto;
    position: relative;
}

.sidebar-loader {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(10, 10, 12, 0.8);
    backdrop-filter: blur(4px);
    z-index: 10;
    display: none;
    align-items: center;
    justify-content: center;
}

.sidebar-user-info {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
}

.sidebar-avatar {
    width: 72px;
    height: 72px;
    background: linear-gradient(135deg, #6366f1 0%, #a855f7 100%);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
}

.sidebar-email {
    color: var(--text-secondary);
    font-size: 0.9rem;
}

.sidebar-balance-card {
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.2) 0%, rgba(168, 85, 247, 0.2) 100%);
    border: 1px solid rgba(99, 102, 241, 0.3);
    border-radius: 16px;
    padding: 10px;
    text-align: center;
    width: 100%;
}

.balance-label {
    color: var(--text-secondary);
    font-size: 0.85rem;
    margin-bottom: 8px;
    text-align: center;
}

.balance-amount {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
}

.balance-unit {
    font-size: 1.5rem;
}

#sidebar-balance {
    font-size: 2rem;
    font-weight: 700;
    background: linear-gradient(135deg, #6366f1 0%, #a855f7 50%, #ec4899 100%);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

.sidebar-actions {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-top: auto;
    width: 100%;
    padding-bottom: 20px;
}

.sidebar-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    padding: 14px 20px;
    border-radius: 12px;
    font-size: 0.95rem;
    font-weight: 600;
    width: 100%;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    background: transparent;
    border: 1px solid transparent;
    color: var(--text-primary);
    cursor: pointer;
    text-decoration: none;
}

.sidebar-btn-recharge {
    background: var(--primary-gradient);
    color: white;
    border: none;
    box-shadow: 0 4px 15px rgba(99, 102, 241, 0.2);
}

.sidebar-btn-recharge:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(99, 102, 241, 0.4);
    background: var(--primary-gradient);
}

.sidebar-btn-contact {
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
}

.sidebar-btn-contact:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: rgba(255, 255, 255, 0.2);
    transform: translateY(-2px);
}

/* ===== Sidebar Invite Card ===== */
.sidebar-invite-card {
    width: 100%;
    background: var(--glass-bg);
    /*亮蓝色*/
    border: 3px solid rgb(0 255 255);
    border-radius: 16px;
    padding: 16px;
}

.invite-title {
    margin: 0 0 12px;
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--text-primary);
    text-align: center;
}

.invite-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 8px;
    gap: 8px;
}

.invite-label {
    font-size: 0.8rem;
    color: var(--text-secondary);
    white-space: nowrap;
    flex-shrink: 0;
}

.invite-value-wrapper {
    display: flex;
    align-items: center;
    gap: 6px;
    min-width: 0;
    flex: 1;
    justify-content: flex-end;
}

.invite-value {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-primary);
    font-family: 'Courier New', monospace;
    letter-spacing: 1px;
}

.invite-link-value {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    max-width: 150px;
    font-size: 0.75rem;
    letter-spacing: 0;
}

.invite-copy-btn {
    background: none;
    border: 1px solid var(--glass-border);
    border-radius: 6px;
    padding: 4px 6px;
    cursor: pointer;
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    flex-shrink: 0;
}

.invite-copy-btn:hover {
    color: #6366f1;
    border-color: #6366f1;
    background: rgba(99, 102, 241, 0.1);
}

.invite-copy-btn.copied {
    color: #22c55e;
    border-color: #22c55e;
}

.invite-desc {
    margin-top: 8px;
    padding-top: 8px;
    border-top: 1px solid var(--glass-border);
    font-size: 0.8rem;
    color: var(--text-secondary);
    text-align: center;
    line-height: 1.4;
}

.sidebar-btn-logout {
    color: #ef4444;
    border: 1px solid rgba(239, 68, 68, 0.3);
    margin-top: 12px;
}

.sidebar-btn-logout:hover {
    background: rgba(239, 68, 68, 0.1);
    border-color: #ef4444;
    transform: translateY(-2px);
}

@media (max-width: 600px) {
    .user-sidebar {
        width: 66.67vw;
    }
}

/* ===== Pull to Refresh Indicator ===== */
.pull-to-refresh-indicator {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 9990;
    display: flex;
    align-items: center;
    justify-content: center;
    height: 0;
    overflow: hidden;
    transition: height 0.2s ease;
    pointer-events: none;
    background: linear-gradient(180deg, rgba(99, 102, 241, 0.15) 0%, transparent 100%);
}

.pull-to-refresh-indicator.pulling {
    transition: none;
}

.pull-to-refresh-indicator.refreshing {
    height: 56px;
    transition: height 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.pull-to-refresh-icon {
    width: 28px;
    height: 28px;
    transition: transform 0.2s ease, opacity 0.2s ease;
    opacity: 0.7;
}

.pull-to-refresh-indicator.pulling .pull-to-refresh-icon {
    transition: none;
}

.pull-to-refresh-icon svg {
    width: 100%;
    height: 100%;
    fill: none;
    stroke: #a78bfa;
    stroke-width: 2.5;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.pull-to-refresh-icon.reached {
    opacity: 1;
}

.pull-to-refresh-icon.reached svg {
    stroke: #6366f1;
}

/* Spinner replaces arrow during refresh */
.pull-to-refresh-spinner {
    width: 24px;
    height: 24px;
    border: 3px solid rgba(99, 102, 241, 0.2);
    border-top-color: #6366f1;
    border-radius: 50%;
    animation: rotation 0.8s linear infinite;
    display: none;
}

.pull-to-refresh-indicator.refreshing .pull-to-refresh-icon {
    display: none;
}

.pull-to-refresh-indicator.refreshing .pull-to-refresh-spinner {
    display: block;
}